#include "Includes.h"
#include "ALL.c"


#define Auto_Key   vexRT[Btn7U]

#define Only_Manaul 0

task main()
{
	int all_time_s=120;
	int auto_time_100_ms=auto_time_s*10;
	int manaul_time_100_ms=all_time_s*10-auto_time_100_ms;
	///////////////////////
	if(Only_Manaul)
	{
		StartTask(usercontrol);
		while(1)
			wait1Msec(2000);
	}
	//////////////////////////////////
	writeDebugStream("_User_task_main\n");
	pre_auto();//init

	while(!Auto_Key) { wait1Msec(5);}; //auto
	ClearTimer(T4);
	StopTask(usercontrol);
	StartTask(autonomous);
	while(time100[T4]<auto_time_100_ms)
		wait1Msec(100);
	StopTask(autonomous);

	ClearTimer(T4);
	StartTask(usercontrol);
	while(time100[T4]<manaul_time_100_ms)
		wait1Msec(100);
	StopTask(usercontrol);


	while(1)
		wait1Msec(2000);

}
